<template>
 <IndexDef v-if="indexStyle === 0"></IndexDef>
  <IndexChart v-if="indexStyle === 1"></IndexChart>
  <IndexBdc v-if="indexStyle == 2"></IndexBdc>
  <IndexTask v-if="indexStyle == 3"></IndexTask>
<!--  <div style="width: 100%; text-align: right; margin-top: 20px">
    请选择首页样式：
    <a-radio-group v-model:value="indexStyle">
      <a-radio :value="0">默认</a-radio>
      <a-radio :value="1">销量统计</a-radio>
      <a-radio :value="2">业务统计</a-radio>
      <a-radio :value="3">我的任务</a-radio>
    </a-radio-group>
  </div>-->

  <NoticeModal @register="register"></NoticeModal>

</template>
<script lang="ts" setup name="dashboard-analysis">
  import { ref,nextTick,onMounted } from 'vue';

  import IndexDef from './homePage/IndexDef.vue';
  import IndexChart from './homePage/IndexChart.vue';
  import IndexBdc from './homePage/IndexBdc.vue';
  import IndexTask from './homePage/IndexTask.vue';
  import NoticeModal from './components/NoticeModal.vue';
  import { useUserStore } from "/@/store/modules/user";
  import {BasicModal, useModal, useModalInner} from '/@/components/Modal';
  import {useListPage} from "/@/hooks/system/useListPage";
  import {listInHalfMonth} from '/@/views/assets/leaseContract/DbHtb.api';
  const userStore = useUserStore();
  console.log(userStore.userInfo)
  //userStore.userInfo.realname
  const indexStyle = ref(2);

  const [register, { openModal}] = useModal();

  onMounted(()=>{
    nextTick(() => {
     listInHalfMonth().then((res)=>{
        console.log(res);
        if(res.records.length!=0){
          openModal(true, {
          });
        }
      });

    });
  });

</script>
